package com.easytake.emotioncat.controller;

import com.easytake.emotioncat.dto.PageResult;
import com.easytake.emotioncat.dto.Response;
import com.easytake.emotioncat.entity.EmHelpEntity;
import com.easytake.emotioncat.service.IEmHelpService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 常见问题,操作记录 前端控制器
 * </p>
 *
 * @author baomidou
 * @since 2022-11-07
 */
@RestController
@RequestMapping("/emHelp")
public class EmHelpController {
    @Autowired
    IEmHelpService emHelpService;

    @Operation(summary = "分页查询帮助")
    @GetMapping
    @Parameter(name = "pageNo", description = "页码")
    @Parameter(name = "pageSize", description = "每页显示数量")
    @Parameter(name = "category", description = "类型 1-常见问题 2-操作教程")
    public Response<PageResult<EmHelpEntity>> getList(@RequestParam Integer pageNo, @RequestParam Integer pageSize, @RequestParam Integer category) {
        PageResult<EmHelpEntity> pageResult = emHelpService.getListByPage(pageNo, pageSize, category);
        return Response.success(pageResult);
    }
}
